Fix network-bridge ifup problem when bridge has no IP address.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 23 Jun 2009 10:22:08 +0000 (11:22 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 23 Jun 2009 10:22:08 +0000 (11:22 +0100)
When we want to setup a bridge without a ip address, function
do_ifup will not activate the bridge.

We should make the bridge active, then vif-bridge can work on the
bridge.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
tools/hotplug/Linux/network-bridge

index 954c0160b79a1860f61c540e5745dcf3e5e1b6de..95aaba0c150866dc54806d5047cb2caf78896f4f 100644 (file)
@@ -111,9 +111,9 @@ do_ifup() {
             # use the info from get_ip_info()
             ip addr flush $1
             ip addr add ${addr_pfx} dev $1
-            ip link set dev $1 up
-            [ -n "$gateway" ] && ip route add default via ${gateway}
         fi
+        ip link set dev $1 up
+        [ -n "$gateway" ] && ip route add default via ${gateway}
     fi
 }